<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>::Patani Forum:: Upload Gallery</title>
</head>
<body>
<?php 
$album_id = "";
$album_name = "";
$album_description = "";
$photographer = "";
if(isset($_GET['album_id'],$_GET['album_name'],$_GET['photographer'])){
	$album_id = $_GET['album_id'];
	$album_name = $_GET['album_name'];
	$album_description = $_GET['albumdescription'];
	$photographer = $_GET['photographer'];	
}

?>
<script type="text/javascript">
function edit_album()
{
	if(document.getElementById('dia_gallery_editAlbumName').value == "")
	{
		alert("กรุณาระบุชื่ออัลบั้ม");
		return;
	}
	else if(document.getElementById('dia_gallery_editAlbumPhotographer').value == "")
	{
		alert("กรุณาระบุช่างภาพ");
		return;
	}
	else
	{
		document.getElementById("album_name").value = document.getElementById("dia_gallery_editAlbumName").value;
		document.getElementById("album_description").value = document.getElementById("dia_gallery_editAlbumDescription").value;		
		document.getElementById("album_photographer").value = document.getElementById("dia_gallery_editAlbumPhotographer").value;
		document.forms["formSubmit"].submit();
	}
}
</script>
<h2>แก้ไข Album</h2>
ชื่ออัลบั้ม : <input type="text" id="dia_gallery_editAlbumName" name="dia_gallery_editAlbumName" value="<?=$album_name ?>"/><br/>
คำอธิบาย : <input type="text" id="dia_gallery_editAlbumDescription" name="dia_gallery_editAlbumDescription" value="<?=$album_description ?>"/><br/>
ผู้ถ่าย: <input type="text" id="dia_gallery_editAlbumPhotographer" name="dia_gallery_editAlbumPhotographer" value="<?=$photographer ?>"/><br/>
<input type="submit" value="Submit" Onclick="edit_album()"></input>

<form id="formSubmit" action="../command/image/editAlbum.php" method="post">
	<input type="hidden" id="album_id" name="album_id" value="<?=$album_id ?>"/>
	<input type="hidden" id="album_name" name="album_name"/>
	<input type="hidden" id="album_description" name="album_description"/>
	<input type="hidden" id="album_photographer" name="album_photographer"/>	
</form>
</body>
</html>

